<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CodeMirror Editor</title>
    <link rel="stylesheet" href="/static/css/public/codemirror.min.css">
    <link rel="stylesheet" href="/static/css/public/eclipse.min.css">
    <script src="/static/js/codemirror.min.js"></script>
    <script src="/static/js/sql.min.js"></script>
    <style>
        .CodeMirror {
            height: auto;
        }
    </style>
</head>
<body>
<textarea id="code" name="code">SELECT * FROM users WHERE id = 1;</textarea>
<script>
    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        mode: "text/x-sql",
        theme: "eclipse"
    });

    function getCode() {
        return editor.getValue();
    }

    function setCode(code) {
        editor.setValue(code);
    }
</script>
</body>
</html>
